import Vue from 'vue'
import Vuex from 'vuex'
//1.安装vuex
Vue.use(Vuex);
//2.创建store对象
const store = new Vuex.Store({
  state:{
    roleId:0,//定义共享的RoleId角色编号
    empName:'',//定义共享的empName员工姓名
  },
  mutations:{
    setRoleId(state,roleId){
      return state.roleId = roleId;
    },
    setEmpName(state,empName){
      return state.empName = empName;
    }
  }
});
//3.暴露store对象
export default store;
